﻿<!--
	@create by 
	@update by 
	@description 
-->
<div>
    <el-form-q ref="refq" :field-data="queryFields" :buttons="queryButtons"></el-form-q>
    <div class="yu-toolBar">
        <el-button-group>
            <el-button icon="plus" @click="addFn" v-if="checkPermission('create')">新增</el-button>
            <el-button icon="edit" @click="modifyFn" v-if="checkPermission('edit')">修改</el-button>
            <el-button icon="document" @click="infoFn" v-if="checkPermission('detail')">查看</el-button>
            <el-button icon="yx-bin" @click="deleteFn" v-if="checkPermission('delete')">注销</el-button>
            <el-button icon="edit" @click="setDutyFn" v-if="checkPermission('setDuty')">设置岗位</el-button>
            <el-button icon="edit" @click="setRoleFn" v-if="checkPermission('setRole')">设置角色</el-button>
            <el-button icon="edit" @click="pwdFn" v-if="checkPermission('setPassword')">重置密码</el-button>
        </el-button-group>
    </div>
    <el-table-x ref="reftable" :row-index="true" :radiobox="false" :base-params="baseParams"
                :data-url="reftableDataUrl" :table-columns="tableColumns" :request-type="'POST'"></el-table-x>

    <!-- 说明dialog可配置宽高属性，若不配置则宽度默认为屏幕50%，高度自适应 width="650px" height="380px" -->
    <el-dialog :title="viewTitle[viewType]" :visible.sync="dialogVisible" size="large">
        <el-form-q ref="refq1" :field-data="queryUserFields" :buttons="queryUserButtons" style="padding-left:160px;width:1620px"></el-form-q>
        <el-form-x ref="reform" :group-fields="updateFields" :buttons="updateButtons"
                   :disabled="formDisabled" label-width="160px">
        </el-form-x>
    </el-dialog>

    <!-- 修改弹框 -->
    <el-dialog :title="viewTitle[viewType]" :visible.sync="modifyDialogVisible" size="large">
        <el-form-q ref="refr" :field-data="replaceFields" :buttons="replaceButtons" label-width="80px"
                style="padding-left:160px;width:1590px">
        </el-form-q>
        <el-form-x ref="reform1" :group-fields="modifyFields" :buttons="modifyButtons"
                   :disabled="formDisabled" label-width="160px">
        </el-form-x>

    </el-dialog>

    <!-- 查看弹框 -->
    <el-dialog :title="viewTitle[viewType]" :visible.sync="infoDialogVisible" size="large">
        <el-form-x ref="reform2"
                   :group-fields="infoFields" :buttons="infoButtons"
                   :disabled="formDisabled" label-width="160px">
        </el-form-x>
    </el-dialog>

    <el-dialog :title="'设置岗位'" :visible.sync="dutyDialogVisible" width="600px">
        <el-transfer style="margin-left: 3rem" v-model="setDuty" :data="dutyData"
                     :titles="['可分配岗位','已选岗位']"></el-transfer>
        <br>
        <div style="text-align: center;">
            <el-button icon="edit" @click="sendDutyFn">确定</el-button>  <!-- v-if="checkPermission('edit')" -->
        </div>
    </el-dialog>

    <el-dialog :title="'设置角色'" :visible.sync="roleDialogVisible" width="600px">
        <el-transfer style="margin-left: 3rem" v-model="setRole" :data="roleData"
                     :titles="['可分配角色','已选角色']">
        </el-transfer>
        <br>
        <div style="text-align: center;">
            <el-button icon="edit" @click="sendRoleFn">确定</el-button> <!-- v-if="checkPermission('edit')" -->
        </div>
    </el-dialog>

</div>
